home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tspa2560.zip / TSPAS.NWS < prev    next >
Text File  |  1991-10-27  |  22KB  |  425 lines

  1. News on the TSPAS package by Timo Salmi in reverse order
  2. ========================================================
  3.  
  4. University of Vaasa, Finland, MIPS R2030 workstation garbo.uwasa.fi
  5. has a large collection of PD and shareware PC programs available by
  6. anonymous ftp and mail server. The file /pc/ts/0news-ts contains
  7. news about the TS-programs in the /pc/ts directory (in reverse
  8. order). This text, which you now have, is an extract from the
  9. 0news-ts file and the UseNet news.
  10. ...................................................................
  11. Prof. Timo Salmi        
  12. Moderating at garbo.uwasa.fi anonymous ftp archives 128.214.87.1
  13. School of Business Studies, University of Vaasa, SF-65101, Finland
  14. Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun
  15. ...................................................................
  16.  
  17. ┌────────────────────────────────────────────────────────────────┐
  18. │ Appeal: Let me take up a request for those of you who may have │
  19. │ found my programs or units useful.  As I am not asking for a   │
  20. │ registration fee for the PD versions, would you do me a        │
  21. │ reciprocal favor by uploading at least some of my packages to, │
  22. │ say eg one local bulletin board (BBS), and thus contribute to  │
  23. │ disseminating the *latest* versions of these packages.  And,   │
  24. │ if you distribute these packages, would you PLEASE distribute  │
  25. │ an entire package, not individual programs from within any     │
  26. │ package. This is a request that all of us share who write PD   │
  27. │ programs.                                                      │
  28. └────────────────────────────────────────────────────────────────┘
  29.  
  30. Sun 27-Oct-91: I have updated my Turbo Pascal units collection to be
  31.  garbo.uwasa.fi:/pc/ts/tspa2440.arc
  32.  garbo.uwasa.fi:/pc/ts/tspa2450.arc
  33.  garbo.uwasa.fi:/pc/ts/tspa2455.arc
  34.  garbo.uwasa.fi:/pc/ts/tspa2460.arc
  35. by adding the following routines
  36.   ISANSIFN Has ansi.sys a a similar driver been loaded
  37.   BTEWRDFN Combine two bytes into a single word, inverse of Hi & Lo
  38.   WRDLNGFN Combine two words into a longint
  39.   HIWORDFN The high-order (hi) word of the longint argument
  40.   LOWORDFN The low-order (lo) word of the longint argument
  41.  
  42. Sun 21-Jul-91: I have updated my Turbo Pascal units collection to be
  43. /pc/ts/tspa24##.arc (where ## = 40, 50, 55, and 60).
  44.    Turbo Pascal 5.0 (and later) introduced some routines which are
  45. not present in version 4.0. My Turbo Pascal units collection (the
  46. 4.0 version) includes a TSTPU45 unit which introduces some of the
  47. missing routines also to TP 4.0. I have added FExpand (Expand a file
  48. name into a fully qualified file name) to this unit.
  49.    Occasionally you will want to be able to tell where the standard
  50. input to your program comes from.  Does it come in the normal way
  51. from the keyboard, or does it come from redirection. Likewise, you
  52. may wish your program to know whether its standard output goes to
  53. the screen, or is it redirected to a file or through a pipe. The
  54. new boolean functions in the TSUNTH.TPU unit will give this
  55. information:
  56.   PIPEDIFN Is the standard input from redirection
  57.   PIPEDOFN Is the standard output redirected
  58.   PIPEDNFN Is the standard output redirected to nul
  59. Other new routines in the TSUNTH unit include:
  60.   BOOTDRFN Get boot device name (MsDos 4.0+)
  61.   DATEFMFN Country-dependent date format (MsDos 3.0+)
  62.   NRCYLFN  Number of cylinders on a drive if media present (MsDos 3.2+)
  63.   TIMEFMFN Country-dependent time format (MsDos 3.0+)
  64.   Z2ASZFN  Convert an Asciiz string into an ordinary ascii string
  65.  
  66. Tue 8-Jan-91: My Turbo Pascal units collection is now available also
  67. for Turbo Pascal 6.0. It is /pc/ts/tspa2360.arc, and is in no other
  68. way different from tspa2340.arc, tspa2350.arc, and tspa2355.arc
  69. except that the units are for 6.0. As you know, Turbo Pascal units
  70. are not compatible across versions.
  71.  
  72. Sat 5-Jan-91: I have upgraded my Turbo Pascal units collection at
  73. uwasa.fi archives by making several changes. Most importantly I have
  74. divided the package into three parallel packages:
  75.   tspa2340.arc  for Turbo Pascal 4.0 version
  76.   tspa2350.arc  for Turbo Pascal 5.0 version
  77.   tspa2355.arc  for Turbo Pascal 5.5 version
  78. Thus you'll only need the package concurring with the Turbo Pascal
  79. version you use yourself. With the exception of the differences
  80. inherent to the different releases of Turbo Pascal, the packages are
  81. the same.
  82.    I am expecting Turbo Pascal 6.0, but it has not arrived yet.
  83.    I have added a new unit TSERR.TPU which turn on the verbal
  84. run-time error messages. It is very easy to use. Just include
  85.  uses TSERR;
  86. at the beginning of your main program and you'll have verbal
  87. run-time error messages besides the original, cryptic error codes.
  88.    I have done some cleaning of the old units by omitting some of
  89. the older routines which have a more efficient later replacement. In
  90. particular this concerns the functions for converting values from
  91. one base to another.
  92.    There are also new routines:
  93.   PARSENFN Number of substrings in a string (resembles ParamCount)
  94.   PARSERFN Get substrings from a string (resembles ParamStr)
  95.   FATSFN   Get number of file allocation tables, not XTs
  96.   INTERLFN Get interleave coefficient of a harddisk, not XTs
  97.   LASTDRFN Get last drive of the system, softcoded, not XTs
  98. and the generic power function POWERGFN has been rewritten.
  99.  
  100. Wed 8-Aug-90: I have updated my Turbo Pascal (4.0, 5.0, 5.5) units
  101. collection to be version (/pc/ts/)tspas22.arc.
  102.    There are several functions which Tubro Pascal 5.0 and 5.5 have,
  103. but TP 4.0 does not.  I have added a new unit tsunt45.tpu which
  104. includes some of these functions such as EnvCount, EnvStr, GetEnv,
  105. and ParamStr0 (giving the name of the program).
  106.    The unit tsunti.tpu can be used to put information into the .exe
  107. file and perform selftests of the .exe.  This unit is now also
  108. available for TP 4.0.
  109.    Turbo Pascal ReadKey lacks the ability to read special keys such
  110. as RightShift, LeftShift, RightCtrl, and so on.  Functions to detect
  111. pressing these keys have been added.
  112.    Turbo Pascal ReadKey also lacks the ability to cope with the full
  113. enhanced keyboard potential. This means that TP ReadKey does not
  114. detect pressing F11 or F12, and that it cannot distinguish between
  115. the numeric keyboard cursor keys and the grey cursor keys. I have
  116. added a RDENKEFN function which has these abilities.
  117.  
  118. Wed 1-Aug-90: I have updated my Turbo Pascal (4.0, 5.0, 5.5) units
  119. collection to be version (/pc/ts/)tspas21.arc.
  120.    Turbo Pascal version 4.0 does not have the DosVersion function
  121. available in versions 5.0 and 5.5. I have written this function for
  122. version 4.0. Furthermore the lack of this function caused errors in
  123. TP 4.0 versions of my last two units.  This has been put right.
  124.    I have included a new unit (tsunti.tpu) for putting information
  125. into the .exe file, and retrieving the information (not for TP 4.0).
  126. The routines include a method for calculating the direct checksum
  127. for a file (eg for virus checking). This is not as trivial as it may
  128. sound at first sight, because in calculating the checksum, the
  129. checksum constant within the program must be skipped. (Else a change
  130. in the checksum constant would alter the checksum resulting in a
  131. "vicous circle"). Also, the method must be fast enough.
  132.    I have also included a fast a date and filesize checking method
  133. for detecting if the .exe has been pacthed or its size altered. (Of
  134. course, the checksum method is much more difficult to defeat, but it
  135. is more complicated and not as fast). Here I have made an exception
  136. and included the source code. It is in the selftest.pas file within
  137. tspas21.arc.
  138.  
  139. Mon 23-Jul-90: I have updated my Turbo Pascal (4.0, 5.0, 5.5) units
  140. collection to be version (/pc/ts/)tspas20.arc.
  141.    One problem area that has intrigued me for some time is finding a
  142. technique for storing information within an executable file and
  143. updating that information. I've looked into it and written a couple
  144. of relevant procedures. USECOUNT keeps track of how many times the
  145. program has been run and stores the result within the .exe file.
  146. BRANDEXE is a more general, but also a more complicated procedure
  147. for .exe file handling. As an example I have a demonstration how to
  148. tell the previous time when the program was run.
  149.    The function checking the on-line status of the printer
  150. (prnonlfn) has been rewritten to work without Turbo Pascal's Crt
  151. unit. And an alternative printer on-line status function, LTPONLFN,
  152. has been added. This one should be more robust, because it actually
  153. tries to send a carriage return to the printer, and observes the
  154. resultant success of the operation to define the on-line status. Of
  155. course this is achieved by {$I-} {$I+} IOResult testing, but the
  156. real trick here is make to system respond immediately rather than in
  157. the default response time of up to one minute. A new procedure
  158. PRTSCR sends the current screen to the printer. The new routines
  159. GETPRTFN and SETPRT get and set respectively the number of printer
  160. default retry times before a timeout.
  161.    TICKSFN is a simple complement to the TIMERFN already in the
  162. collection. TICKSFN gives the number of clock ticks (there are 18.2
  163. per second) since midnight.
  164.    A new LASTDMFN returns the number of days in a given month and
  165. year. DATEOKFN tells whether a date is a valid, existing date.
  166. ZELLERFN lets you compare which of the two dates is earlier,
  167. calculate the number of days between two dates etc.
  168.    A new FIXEDFN returns whether a drive is a fixed disk or not.
  169. MATHCOFN returns if a math coprocessor is present. RS232FN returns
  170. the number of serial ports. PARPORFN returns the number of parallel
  171. ports. COUNTRFN returns the country code. CHIPFN returns the type of
  172. the processor chip.
  173.    There are new keyboard routines. SCRLONFN gets the current
  174. ScrollLock status. CAPS, NUMLOCK, and SCRLOCK respectively set the
  175. CapsLock, NumLock and ScrollLock on, or off. They take the desired
  176. status as a boolean argument.
  177.   CLS sets 25*80 text mode and clears the screen and CLS40 does
  178. likewise for 25*40. Crt is not required.
  179.    So far none of the routines in the TSPAS collection have included
  180. any inline code. Starting from tspas20.arc this no longer holds. I
  181. have tried to understand some assembler and have included also
  182. inline code. Be warned that I cannot give any guarantees that the
  183. inline coded routines won't cause confusion.  Where inline code has
  184. been used, I have stated so. The first function to utilize this is
  185. LOWCASFN which is the exact opposite of Turbo Pascal's own UpCase
  186. function.
  187.    WARMBOOT simulating alt-clr-del, and COLDBOOT reboot with memory
  188. tests are new, inline routines.
  189.    A couple of routines have been moved from one unit to another.
  190.  
  191. Newsgroups: comp.lang.pascal
  192. From: ts@chyde.uwasa.fi (Timo Salmi)
  193. Subject: Redirecting writes to the printer
  194. Organization: University of Vaasa
  195. Date: Sun, 22 Jul 90 03:58:00 GMT
  196. (*
  197. About half a year ago several posters wanted to find a way to direct
  198. all output to the printer. (To enable a documentation of students'
  199. programming tasks.) For some reason nobody of us then found a simple
  200. working solution, which is outrageously elementary, after fact.
  201. There are, of course, alternative solutions, the most complicated
  202. being writing a new device driver. An intermediate (easier) solution
  203. is to juggle with certain TP predefined constants. I have two
  204. procedures USECON and USEPRN (in /pc/ts/tspas19.arc tpu collection)
  205. which when placed anywhere within the program will change the output
  206. device. But below is an example the the easiest alternative needing
  207. no accessories.
  208. *)
  209. program HowToRedirectAllOutputEasilyToThePrinter;
  210. {$DEFINE printit}
  211. begin
  212.   {$IFDEF printit}
  213.   assign (output, 'prn');
  214.   rewrite (output);
  215.   {$ENDIF}
  216.   :
  217.   writeln ('From Timo Salmi: Hello world, and whatever else');
  218.   :
  219.   {$IFDEF printit}
  220.   close (output);
  221.   {$ENDIF}
  222. end.  (* thus endeth the escapade *)
  223.  
  224. Thu 14-Jun-90: I have updated my Turbo Pascal (4.0, 5.0, 5.5) units
  225. collection to be version (/pc/ts/)tspas19.arc. The function INDRIVFN
  226. in tsuntg.tpu tests whether a device is present in a drive. If you
  227. defined an invalid drive (such as '1'), a run time error occurred in
  228. my earlier versions. - Tsunta.tpu has a new function HIGHTFN, which
  229. gives the height of the screen by resolution (25, 43 or 50). -
  230. Tsuntf.tpu has a third enhanced readln with line editing, recall,
  231. insert toggle, and clean break potential. - Tsunth.tpu includes a
  232. new function ISDIRFNto test whether a name is a directory. -
  233. COPYFILE procedure copies a file from within a Turbo Pascal program
  234. and returns a success status code. I have seen postings in the
  235. (InterNet) news about problems with copying files in Turbo Pascal,
  236. but I hope that this one should do the trick. - OPENEDFN function
  237. indicates whether a text file has already been closed within the
  238. program, or if it is still open. This is particularly convenient for
  239. procedures aborting your program. - Tsuntd includes a new procedure
  240. called AUDIO. It is an enhanced version of Turbo Pascal's own sound
  241. procedure. It takes frequency and duration as parameters, and it
  242. does not need the presence of the interfering Crt unit. Audio was
  243. written in collaboration with Ari Hovila (ajh@chyde.uwasa.fi). - And
  244. since I am often asked the question, sorry, no, dear fellow users,
  245. the sources are not available, only the units and their documented
  246. interfaces.
  247.  
  248. Sun 25-Feb-90: I have gotten repeated requests from the users for a
  249. Turbo Pascal 5.5 version of my Turbo Pascal units collection. I now
  250. have finally got the 5.5 compiler, courtesy of University of Vaasa,
  251. because it was felt here that this international interaction is
  252. important enough to warrant the expense. (As I have told many of the
  253. users who have contacted me in this matter, I am not yet interested
  254. in OOP myself). Hence I am in a position to oblige. The new version
  255. is called tspas18.arc. There is only one new function in the
  256. collection this time. The main point was providing the TP 5.5
  257. versions of the units. Thus there are now three versions of each
  258. unit in this new release: TP 4.0, 5.5, and 5.5. - It is true that
  259. Borland has made excellent products for the PC community, but the
  260. incompatibility between the TPUs of the different Turbo Pascal
  261. versions has many of us users disgruntled.
  262.  
  263. Wed 6-Dec-89: Updated the Turbo Pascal 5.0 (and 4.0) units
  264. collection to be version /pc/ts/tspas17. The new procedures include
  265. WHEREXFN and WHEREYFN which locate the cursor position without the
  266. Crt unit. As you will recall Crt unit includes a WhereX and a WhereY
  267. function. The reason I have prepared alternatives to Crt functions
  268. and procedures in this, and the earlier releases, is because with
  269. some incompatible PCs the Crt unit causes problems, and redirection
  270. requires special measures with the Crt. - KEYPREFN is a replacement
  271. of KeyPressed and READKEFN for ReadKey. - CLUSIZFN gives the cluster
  272. size on a device. ALLSIZFN gives the true total size allocated to a
  273. file instead of the size shown on ordinary directory listings. -
  274. INKEYFN is a Basic-like timed input.
  275.  
  276. Tue 28-Nov-89: Some time ago there was a lively discussion in the
  277. InterNet news group comp.lang.pascal how to redirect all write and
  278. writeln statements to the printer without having to change the
  279. statements. I now have a solution to that problem for Turbo Pascal
  280. 4.0 and 5.0. The procedures USEPRN and USECON are part of update
  281. /pc/ts/tspas16.arc of my Turbo Pascal 5.0 and 4.0 units collection.
  282. The new procedures/functions also include WEEKNRFN function in the
  283. TSUNTE unit. It gives the weeknumber for a given date. REVCOLOR in
  284. TSUNTC reverses (toggles) text colors. And there are many other new
  285. routines making up a new unit TSUNTG.
  286.  
  287. Thu 26-Oct-89: I have a private mailing list for emailing these
  288. update news. Especially, if you have my programs downloadable at
  289. your site or your BBS you are welcome to ask for inclusion on this
  290. list.
  291.  
  292. Wed 18-Oct-89: Released update /pc/ts/tspas15.arc of my Turbo Pascal
  293. 5.0 and 4.0 units collection. New procedures/functions include BINFN
  294. in TSUNTB for fast conversion of decimal words to binary and HEXFN
  295. for fast conversion to hexadecimal. LBIN and LHEX convert long
  296. integers fast to binary and hexadecimal respectively. POWERLFN
  297. raises a longint to a power, fast. BORDER in TSUNTE changes the
  298. border color for CGA or VGA. All the rest of the procedures and
  299. functions remain unchanged.
  300.  
  301. Tue 26-Sep-89: Released update /pc/ts/tspas14.arc of the Turbo
  302. Pascal 5.0 and 4.0 units collection. The package contains units from
  303. tsunta.tpu to tsuntf.tpu. Tsunte.tpu contains a new function
  304. cmdlnfn, which gives the entire command line in a program call. The
  305. input line-editing procedure edreadln in tsuntf.tpu now has a recall
  306. option (CursorUp) and the insert key toggle. I have preserved an
  307. edrdln procedure for line-editing without recall and insert. Tsuntd
  308. has new ParamCount and ParamStr like functions for obtaining
  309. substrings from a string.
  310.  
  311. Sat 19-Aug-89: Released update /pc/ts/tspas13.arc of my Turbo Pascal
  312. units.  I have rewritten the cursor-size routines in a more general
  313. fashion and rearranged the units. 
  314.    One of the weaknesses of the readln statement in (Turbo) Pascal
  315. is that it does not allow editing the input-string while giving the
  316. input from the keyboard.  I decided to do something about this, and
  317. wrote an edreadln procedure, which allows to use of LeftCursor,
  318. RightCursor, BackSpace, Del, Home, End, and Esc.  Of course such
  319. routines are very common in input from popup windows.  Edreadln is,
  320. however, more of a readln-type procedure with normal scrolling
  321. capabilities, than a fixed position window routine.  This routine is
  322. included in the new release. 
  323.  
  324. Wed 2-Aug-89: I have released un updated version of the Turbo Pascal
  325. units collection tspas12.arc.  There are new string routines and
  326. detection of the monitor (mono/color) type.
  327.  
  328.  
  329. =======================================================================
  330.                   Messages from UseNet news
  331. =======================================================================
  332.  
  333. From ts Sat Jul 28 09:25:43 1990
  334. Subject: Re: Program selftesting and viruses
  335. To: 16012_3045@uwovax.uwo.ca (Paul Gomme)
  336. Date: Sat, 28 Jul 90 9:25:43 EET DST
  337. In-Reply-To: <0649102756@uwovax.uwo.ca>; from "Paul Gomme" at Jul 27, 90 6:19 pm
  338. X-Mailer: ELM [version 2.2 PL16]
  339. Status: OR
  340.  
  341. > >     Programmers: Help fighting viruses and patching.
  342. > >
  343. > >Viruses and unauthorized patching are problems which should be
  344. > >fought against by the PC community. This program demonstrates a
  345. > >simple and a reasonably general, fast selftest to detect whether the
  346. > >program has caught a virus, or if it has been amateurishly patched.
  347. > >The code is easily incorporated in any Turbo Pascal source code. The
  348. > >idea is to check whether the file date and size have been altered.
  349. > >Most .exe viruses work by appending their code to the .exe file
  350. > >altering the file size. Trivial patching changes the file date.
  351. > >Either of these is detected by selftest.
  352. > While the idea may have some merits, the execution is flawed.
  353.                                                         ^^^^^^
  354. No Paul, not flawed.  Rather not foolproof, nor is meant to be. 
  355.  
  356. > First, it is a minor matter to obtain the creation date of a file. 
  357. > Consequently, it is a relatively simple matter to apply a patch
  358. > which doesn't alter the file size, and restore the original creation
  359. > date.  Your technique is subject to such an "attack". 
  360.  
  361. Certainly.  The whole philosophy behind is to have a simple method
  362. which staves off any crude attempts.  The problem with the more
  363. elaborate selfchecks (such as embedded checksums) is that they are
  364. difficult to implement. 
  365.  
  366. > Second, there are often good reasons to patch a file.  Some of these
  367. > reasons are cosmetic in nature.  Some programs even encourage user
  368. > patching. 
  369.  
  370. Also true, and then such patching should take care of the date.  Or
  371. the selftest should have a relevant modification or omission of the
  372. date test. 
  373.  
  374. > From a more philosophical point of view, I wonder if protection
  375. > schemes don't in part encourage those who write viruses.  Surely
  376. > part of the "thrill" is to avoid detection. 
  377.  
  378. Maybe.  It can be looked at as a kind of a game.  Nevertheless,
  379. consider the popularity eg McAfee's virus control programs have
  380. gained.  Throwing one's hands up in the air is not a good solution. 
  381.  
  382. All the best, Timo
  383.  
  384. =======================================================================
  385.  
  386. From ts Tue Jul 31 12:07:13 1990
  387. Return-Path: <ts>
  388. Received: by uwasa.fi (4.1/(hh)29May89)
  389.     id AA08907; Tue, 31 Jul 90 12:07:12 +0300
  390. From: Timo Salmi LASK <ts>
  391. Message-Id: <9007310907.AA08907@uwasa.fi>
  392. Subject: selftest
  393. To: ts (Timo Salmi LASK)
  394. Date: Tue, 31 Jul 90 12:07:11 EET DST
  395. X-Mailer: ELM [version 2.2 PL16]
  396. Status: O
  397.  
  398. Newsgroups: comp.lang.pascal
  399. Path: uwasa.fi!ts
  400. From: ts@uwasa.fi (Timo Salmi LASK)
  401. Subject: Re: Program selftesting and viruses
  402. Message-ID: <1990Jul31.085732.8728@uwasa.fi>
  403. Organization: University of Vaasa
  404. References: <1990Jul27.182520.12051@uwasa.fi> <1875@krafla.rhi.hi.is>
  405. Date: Tue, 31 Jul 90 08:57:32 GMT
  406.  
  407. In article <1875@krafla.rhi.hi.is> frisk@rhi.hi.is (Fridrik Skulason) writes:
  408. >This program works in most cases - however, it is not effective against some
  409. >of the latest viruses, which fool it by making the program appear unchanged,
  410. >after the virus is in control.
  411.  
  412. This is certainly true, and the purpose of the code is to easily
  413. weed out elementary cases, which are the most frequent anyway.  One
  414. of the points was to make the code simple to understand and include. 
  415. The other alternative is to imbed a checksum in the .exe file.  But
  416. the code is much more complicated, because the checksum (either
  417. direct or crc) constant itself within the program must be skipped
  418. when recalculating the checksum.  Another problem is that the
  419. checksum must be calculated fast.  Else it renders the host program
  420. useless.  I have the code also for calculating and checking the
  421. direct checksum of an .exe file in addition to size & date check. 
  422. This should be fairly effective.  This will be included in the
  423. upcoming update of my Turbo Pascal units tspas21.arc. 
  424.